-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/parameter improvements #651
Feature/parameter improvements #651
Conversation
Remove max_delay because it did not seem to work. For more info see bullet point microsoft#600. This breaks code that used max_delay
Additional changes - max_val_age is temporarily useless (to be moved to GetLatest) - creating set val temporarily moved to init max_val_age temporarily unusable
Set now handles both cases
Naming was confusing
Was unnecessary
Max val age is now always checked when get_latest is asked. A consequence is that parameter.get_latest will perform a get() if the last get was performed more than max_val_age ago.
…e/parameter_improvements
…rameter.get() Accidentally removed exception in a previous commit
Still need to update docstrings
Other parameters, such as MultiParameter, may also need some sort of validation. Will see in the future if validate may instead be an abstract base method that should be overridden When get_cmd is None and .get is not set, it will be equal to get_latest When set_cmd is None and .set is not set, it will be equal to saving the value. This behaviour is equal to the ManualParameter
hi @nulinspiratie I will let @jenshnielsen and @WilliamHPNielsen take over this :D |
Seems sensible at a first look but I am a bit worried about removing Manual and StandardParameter there is a lot of code using it both in QCoDeS and in other modules. I think we would at least need to deprecate them for several months before removing them |
@WilliamHPNielsen the validator is now set by default to Enum if val mapping is provided. I also updated the docstrings, removed trailing whitespaces etc. I think I've done all I can do now. @jenshnielsen how do we proceed? |
@nulinspiratie looks good. There is a test for the default validator being number that needs to be changed or removed |
@jenshnielsen fixed! |
Running through the driver examples again to check if stuff works. Keithley 2600... Passed with warnings ( Keysight 33500B... Passed with warnings ( QDac Channels... Passed with warnings ( SR830... Failed because of Tektronix AWG5014C... Passed with warnings ( |
Upshot from the above test: we need to fix the SR830 driver. The channelised QDac warnings are not introduced by this PR, so we should fix them separately. My verdict: 💃 ! |
I would prefer not to break any drivers Is there any problem with restoring
I tend to think that Deprecation warnings should not use the logging module but do warnings.warn |
@jenshnielsen, I think it's fine to deprecate as you suggest. Note that |
Yes let me do that now |
this will be removed after a deprecation cycle
@WilliamHPNielsen pushed, from my point of view this is ready to land |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yippie-kay-yay!
Author: Serwan Asaad <serwan.asaad@gmail.com> Feature/parameter improvements (#651)
Author: Serwan Asaad <serwan.asaad@gmail.com> Feature/parameter improvements (#651)
Fixes parameter issues raised in #600 (except CombinedParameter), and maybe also #498, #92. See below for list of open questions
Major parameter changes
Other changes
parameter.get_latest()
. It now will return the latest value, unless it was obtained longer thanmax_val_age
ago, in which case it will perform a newget()
. This ensures that a value is never used that is older thanmax_val_age
. Part of this includes movingmax_val_age
into GetLatest.max_delay
,delay_tolerance
as they were not doing anything. If anyone knows what they are supposed to do please let me knowget/set_delay
into propertydelay
intopost_delay
, i.e. delay (settling time) after eachget()
inter_delay
, i.e. minimum delay between successiveget()
callsget_step/set_step
to property_set_get/_set_set
to_initialize_get/_initialize_set
because naming was confusingvalidate_and_set
,validate_and_sweep
toset()
get_sweep_values
method to BaseParameter, used when performing a .set. It's default behaviour is to simply return the same value, but if step is defined, it will return a list of sweep values (taken from StandardParameter).scale
, which can scale (convert) its value. This can be handled in the get/set wrappers. Additionally, araw_value
should be an attribute which is included in the metadataparam.sweep(vals=sweep_vals)
vsparam[sweep_vals]
. Required changing SweepFixedValuesfull_name
, replace bystr(parameter)
.full_name
is kept with deprecation warning_latest_val
,_latest_ts
into_latest
dict attr, remove_latest
methodno_getter/setter
, as they are no longer usedmeta_attrs
that are not None are included. As there are now more possible attrs that are by default included, this could otherwise lead to significant overhead when obtaining a snapshot of all parameters.Open questions
@giulioungaretti @jenshnielsen @WilliamHPNielsen @MerlinSmiles